<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>流程图DEMO</title>

<link rel="stylesheet" type="text/css" href="static/technological/layer/skin/layer.css"/>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="static/technological/layer/layer.js"></script>

<link rel="stylesheet" type="text/css" href="static/technological/my.css">

</head>
<body>
<div id="demo2" style="margin:10px"></div>
<input id="workFlowId" style="display:none" value="${workFlowId}">
<!-- <input id="submit" type="button" value='返回' onclick="jump()"/> -->
<textarea id="result" row="6" style="display:none"></textarea>
</body>
<script type="text/javascript" src="static/technological/my.js"></script>
<script type="text/javascript">
//var jsondata={"title":"业务审批流程","nodes":{"demo_node_1":{"name":"登记","left":25,"top":71,"type":"start round","width":24,"height":24,"alt":true},"demo_node_3":{"name":"分管领导批","left":920,"top":44,"type":"task","width":109,"height":40,"alt":true},"demo_node_6":{"name":"分件","left":73,"top":60,"type":"fork","width":100,"height":24},"demo_node_8":{"name":"XX科审批","left":1153,"top":436,"type":"task","width":100,"height":24,"alt":true},"demo_node_9":{"name":"XX科审批","left":171,"top":25,"type":"task","width":100,"height":24},"demo_node_20":{"name":"局领导审批","left":1263,"top":204,"type":"task","width":111,"height":49,"alt":true},"demo_node_23":{"name":"打证发件","left":617,"top":191,"type":"task","width":100,"height":24,"alt":true},"demo_node_25":{"name":"归档","left":811,"top":425,"type":"end round","width":24,"height":24,"alt":true}},"lines":{"demo_line_7":{"type":"sl","from":"demo_node_1","to":"demo_node_6","name":""},"demo_line_11":{"type":"lr","M":122,"from":"demo_node_6","to":"demo_node_9","name":""},"demo_line_12":{"type":"sl","from":"demo_node_8","to":"demo_node_3","name":"","alt":true},"demo_line_24":{"type":"sl","from":"demo_node_20","to":"demo_node_23","name":""},"demo2_line_28":{"type":"sl","from":"demo_node_25","to":"demo_node_3","name":"","alt":true},"demo2_line_29":{"type":"sl","from":"demo_node_23","to":"demo_node_8","name":"","alt":true},"demo2_line_30":{"type":"sl","from":"demo_node_20","to":"demo_node_25","name":"","alt":true}},"areas":{},"initNum":31};
var property={
	headLabel:true,
	initLabelText:"审批流程",
	width:500,
	height:300,
	toolBtns:["start round","end round","task"],
	// toolBtns:["start round","end round","task","fork","join"],
	haveHead:true,
	headBtns:["save","undo","redo","reload"],//如果haveHead=true，则定义HEAD区的按钮
	haveTool:true,
	haveGroup:true,
	useOperStack:true
};
var remark={
	cursor:"选择指针",
	direct:"结点连线",
	start:"入口结点",
	"end":"结束结点",
	"task":"任务结点",
	// fork:"分支结点",
	// "join":"联合结点",
	group:"组织划分框编辑开关"
};
var demo;
$(document).ready(function(){
	
	demo=$.createGooFlow($("#demo2"),property);
	demo.setNodeRemarks(remark);
	demo.loadData(${jsondata});
});
var out;
function Export(){
    document.getElementById("result").value=JSON.stringify(demo.exportData());
   
	$.ajax({
		type : "post",
		url : "./saveWorkflowView.html",
		data : {
			"jsondata" : document.getElementById("result").value,
			"id" : ${workFlowId}
		},
		dataType : "json",
		success : function(data) {
			if(data.count != false){
					layer.msg('保存成功！');
				}else{
					layer.msg('保存失败！');
				}
		},
		error : function(data) {
			alert("请求失败");
		}
	});				
}
/* function jump(){
	window.location.href="./repository/show-knowledge-workflow.html";
} */
</script>
</html>
